package day5;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别

        while (in.hasNextLine()) {
            StringBuilder str1 = new StringBuilder(in.nextLine());
            StringBuilder str2 = new StringBuilder(in.nextLine());
            int count = 0;
            for (int i = 0; i <= str1.length(); i++) {
                StringBuilder str = new StringBuilder(str1);
                str.insert(i, str2);
                if (isreserve(str)) {
                    count++;
                }
            }
            System.out.println(count);

        }
    }
    public static boolean isreserve(StringBuilder str) {
        int i = 0;
        int j = str.length() - 1;
        while (i < j) {
            if (str.charAt(i) != str.charAt(j)) {
                return false;
            }
            i++;
            j--;
        }
        return true;
    }
}
